#include <iostream>
using namespace std;
void quick_sort(int arr[], int L, int R)
{
	if (L > R)
		return;
	int left = L+1;
	int right = R;
	int pivot = arr[L];
	while (left <= right)
	{
		if (arr[left] <= pivot)
		{
			left++;
		}
		else
		{
			int tmp = arr[right];
			arr[right] = arr[left];
			arr[left] = tmp;
			right--;
		}
	}
	int tmp = arr[right];
		arr[right] = arr[L];
		arr[L] = tmp;
	quick_sort(arr, L, right - 1);
	quick_sort(arr, right + 1, R);
}
int main()
{
	int arr[] = { 53 ,57, 75, 80, 76, 81, 98, 12, 52, 35 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	quick_sort(arr, 0, sz - 1);
	for (int i = 0; i < sz; i++)
	{
		cout << arr[i] << "  ";
	}
}